package com.nce.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.nce.entity.account.User;
import com.nce.util.ActionLevel;

/**
 *关键字
 * 
 * @author GT
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "report")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Report extends IdEntity  {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -430038188136037356L;
	private String words;
	private User user;
	private String content;
	private String type;
	private Date sdate;
	private Date edate;
	private String file;
	private Date cdate;
	
	
	

	public String getWords() {
		return words;
	}

	public void setWords(String words) {
		this.words = words;
	}
	
	


	public String getFile() {
		return file;
	}

	public void setFile(String file) {
		this.file = file;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "uid")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getSdate() {
		return sdate;
	}

	public void setSdate(Date sdate) {
		this.sdate = sdate;
	}

	public Date getEdate() {
		return edate;
	}

	public void setEdate(Date edate) {
		this.edate = edate;
	}

	public Date getCdate() {
		return cdate;
	}

	public void setCdate(Date cdate) {
		this.cdate = cdate;
	}

	@Override
	public String toString() {
		return "Report [cdate=" + cdate + ", content=" + content + ", edate=" + edate + ", file=" + file + ", sdate="
				+ sdate + ", type=" + type + ", user=" + user + ", words=" + words + ", id=" + id + "]";
	}
	
	

	

}